package com.securitytrace.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 
 * 用户实体类
 *
 */
@Entity
@Table(name="t_user")
public class User implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -2211038465701826905L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private long id;
	
	@Column(length=30)
	private String account;
	
	@Column(length=20)
	private String password; //登录密码
	
	@ManyToOne
	@JoinColumn(name="roleId")
	private Role role;
	
	@ManyToOne
	@JoinColumn(name="addressId")
	private Address address;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Role getRole() {
		return role;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Address getAddress() {
		return address;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getAccount() {
		return account;
	}
}
